package demo1;

public class Test1 {
    public static void main(String[] args) {
        //StringBuffer stringBuffer = "Asdf";  报错
        //StringBuilder stringBuilder = "Asdf";  报错
    }
    public static void main13(String[] args) {
        String str1 = "abcd";
        String str2 = new String("abcd");
        String str3 = "abcd";
        System.out.println(str1 == str2);
        System.out.println(str1 == str3);
    }
    public static void main12(String[] args) {
        String str1 = "";
        System.out.println(str1.isEmpty()); //字符串指向的对象里面什么也没有
        str1 = null;                        //字符串不指向任何对象
        System.out.println(str1);
    }
}
